(ns start
		"Acts as the mainClass from which all options are loaded"
(:gen-class)
(:use user.client server.server user.menuClient user.newMenu))

(defn printInstructions
		"Prints the instructions for the main function"
		[]
		(println "
	Instructions: -main '(<mode> <name>)\n
		Name = the name you want your local copy of the database to have, 
				if no name provided 'db' will be used. Use only with CLIENT mode.
				If used with LOCAL mode that file will be opened as your local database.
		Mode = client if you wish to connect to a server\n
		Mode = server if you wish to mount a server\n
		Mode = local if you wish to run locally")
)

(defn -main
		"Main function that starts the program based on the args
		 args -- A list containing the different parameters to be used in the form of
		 '(\"<mode>\")
		mode = client if you wish to connect to a server\n
		mode = server if you wish to mount a server\n
		mode = local if you wish to run locally"
		([mode]
			(if (= "server" mode) (serve)
				(if (= "local" mode)  (new-menu *input*)
					(printInstructions)
				)
			)
			nil
		)
		([mode host]
			(if (= "client" mode) (make-request "connection" host)
				(printInstructions)
			)
			nil
		)
)
